package com.ping.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import top.jplayer.audio.bean.LoginBean;
import top.jplayer.audio.bean.RecordSleepBean;

import com.ping.greendao.gen.LoginBeanDao;
import com.ping.greendao.gen.RecordSleepBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig loginBeanDaoConfig;
    private final DaoConfig recordSleepBeanDaoConfig;

    private final LoginBeanDao loginBeanDao;
    private final RecordSleepBeanDao recordSleepBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        loginBeanDaoConfig = daoConfigMap.get(LoginBeanDao.class).clone();
        loginBeanDaoConfig.initIdentityScope(type);

        recordSleepBeanDaoConfig = daoConfigMap.get(RecordSleepBeanDao.class).clone();
        recordSleepBeanDaoConfig.initIdentityScope(type);

        loginBeanDao = new LoginBeanDao(loginBeanDaoConfig, this);
        recordSleepBeanDao = new RecordSleepBeanDao(recordSleepBeanDaoConfig, this);

        registerDao(LoginBean.class, loginBeanDao);
        registerDao(RecordSleepBean.class, recordSleepBeanDao);
    }
    
    public void clear() {
        loginBeanDaoConfig.clearIdentityScope();
        recordSleepBeanDaoConfig.clearIdentityScope();
    }

    public LoginBeanDao getLoginBeanDao() {
        return loginBeanDao;
    }

    public RecordSleepBeanDao getRecordSleepBeanDao() {
        return recordSleepBeanDao;
    }

}
